package chapter_3;

public class Test11 {
    public static void main(String[] args) {
        int[] arr = new int[]{23,34,45,56,78,89,12};
        //把78删除
        int index = -1;
        for (int i = 0; i < arr.length; i++){
            if(arr[i] == 78){
                index = i;
                break;
            }
        }
        if(index != -1){
            for (int i = index; i < arr.length - 1; i++) {
                arr[i] = arr[i+1];
            }
            arr[arr.length-1] = 0;
        }
        for (int i : arr) {
            System.out.print(i +" ");
        }
    }
}
